import { Service } from "cl-admin";
import BaseService from "@/service/base";
@Service("asynchronous")
class Asynchronous extends BaseService {
	page({ size, ...args } = {}) {
		let params = {
			pagesize: size,
			...args
		};
		return this.$get("/list", { params }).then(res => {
			return {
				list: res.data,
				pagination: {
					...params,
					size,
					total: res.total
				}
			};
		});
	}
	// 下载处理
	handle(params) {
		return this.$post("/handle", params);
	}
	// 异步下载
	download(params) {
		return this.$post("/download", params);
	}
}
export default Asynchronous;
